package com.molin.innerClass.lambdalianxi2;

public class lianxi2 {
    public static void main(String[] args) {
        //匿名类实现接口功能
        useStringHandler(new StringHandler() {
            @Override
            public void printMessage(String s) {
                System.out.println(s);
            }
        });

        //    lambda
        useStringHandler((String s)->{
            System.out.println(s+"lambda");
        });

    }



    public static void useStringHandler(StringHandler stringHandler){
        stringHandler.printMessage("abd");

    }
}

interface StringHandler{
    void printMessage(String s);
}